<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 分组路由，要访问的话就是admin/路径，比如admin/getUsers
//后台




//后台路由接口


Route::group('admin', function () {
    // 1.定义一个get方式的请求，用于管理员访问用户列表请求
    // 第一个参数是路径，第二个是对应 模块/控制器/方法
    Route::get('getUsers', 'admin/admin/getUsers')->allowCrossDomain();
    //登录接口
    Route::post('adminLand', 'admin/adminLogin/adminLand')->allowCrossDomain();
    //新增用户接口
    Route::post('add', 'admin/admin/add')->allowCrossDomain();
    //修改用户接口
    Route::post('xgadd', 'admin/admin/xgadd')->allowCrossDomain();
    //删除用户接口
    Route::post('adminsc', 'admin/admin/adminsc')->allowCrossDomain();
    //商品管理接口
    Route::get('getStore', 'admin/adminstore/getStore')->allowCrossDomain();
    //商品添加接口
    Route::post('storeadd', 'admin/adminstore/storeadd')->allowCrossDomain();
    //商品图片上传
    Route::post('storeimage', 'admin/adminstore/storeimage')->allowCrossDomain();
    //商品分类数据获取接口
    Route::get('getType', 'admin/adminstore/getType')->allowCrossDomain();
    //订单商品管理
    Route::get('getOrder', 'admin/admin/getOrder')->allowCrossDomain();
    //商品修改接口
    Route::post('xgadds', 'admin/adminstore/xgadds')->allowCrossDomain();
    //商品删除接口
    Route::post('storesc', 'admin/adminstore/storesc')->allowCrossDomain();
});




//前台路由接口
Route::group('home', function () {
    //登录接口
    Route::post('loginLands', 'home/login/login')->allowCrossDomain();
    //商品图片请求
    Route::post('storeImg', 'home/store/storeimg')->allowCrossDomain();
    //加入购物车请求
    Route::post('cartShop', 'home/store/cartshop')->allowCrossDomain();
    //注册账号请求
    Route::post('register', 'home/Register/register')->allowCrossDomain();
    //获取购物车数据
    Route::get('getCartData', 'home/Cart/getCartData')->allowCrossDomain();
    //删除购物车里的物品
    Route::get('cartSc', 'home/cart/cartSc')->allowCrossDomain();
    //订单结算
    Route::get('getOrder', 'home/Cart/getOrder')->allowCrossDomain();
    //获取is_se的值判断在结算页面是否选中
    Route::post('sdsds', 'home/Cart/sdsds')->allowCrossDomain();
    // 新增地址接口
    Route::post('send', 'home/Send/send')->allowCrossDomain();
    //获取地址
    Route::get('getAddress', 'home/Send/getAddress')->allowCrossDomain();
    //点击提交删除购物车表里的数据
    Route::post('tjorder', 'home/Cart/tjorder')->allowCrossDomain();
    //搜索
    Route::post('search', 'home/search/search')->allowCrossDomain();
});
